package com.yzk.train.business.controller;

import com.yzk.train.business.response.TrainQueryResp;
import com.yzk.train.business.service.TrainService;
import com.yzk.train.common.response.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/train")
public class TrainController {

    @Resource
    private TrainService trainService;

    @GetMapping("/all")
    public Result<List<TrainQueryResp>> queryAll() {
        List<TrainQueryResp> list = trainService.queryAll();
        return Result.ok(list);
    }

}
